From: Florian Müllner Date: Sun, 26 Feb 2017 02:33:26 +0000 (+0100) Subject: calendar: Add calendar icon to events X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~495 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=846e3f824305b9a7842380f003677ff85a4013d7;p=gnome-shell.git calendar: Add calendar icon to events Without the boxy background, event messages look a bit plain and unaligned with other messages. Adding an icon addresses this, however as repeating the same icon over and over again in case of many events would be rather noisy, only show it for the top event as in the mockups. https://bugzilla.gnome.org/show_bug.cgi?id=775763 --- diff --git a/js/ui/calendar.js b/js/ui/calendar.js index 71708bfd4..32718ea6d 100644 --- a/js/ui/calendar.js +++ b/js/ui/calendar.js @@ -706,6 +706,14 @@ const EventMessage = new Lang.Class({ this._date = date; this.parent(this._formatEventTime(), event.summary); + + this._icon = new St.Icon({ icon_name: 'x-office-calendar-symbolic' }); + this.setIcon(this._icon); + + this.actor.connect('style-changed', () => { + let iconVisible = this.actor.get_parent().has_style_pseudo_class('first-child'); + this._icon.opacity = (iconVisible ? 255 : 0); + }); }, _formatEventTime: function() {